﻿@model FingerPrint.WebUI.Models.SalesOrder

@{
    ViewBag.Title = "Index";  
}

@*<h2>Edit</h2>*@


@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    @Html.HiddenFor(model => model.SalesOrderID)

    
    <fieldset>
        <legend>SalesOrder</legend>

        <table width="80%" border="0">
          <tr>
            <td class="editor-label" width="10%" scope="row">Order No.:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.TextBoxFor(model => model.SalesOrderNumber)
                @Html.ValidationMessageFor(model => model.SalesOrderNumber)
            </td>
            <td class="editor-label" width="10%" scope="row">Company Code:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.DropDownList("CustomerID", String.Empty)
                @Html.ValidationMessageFor(model => model.Customer.CompanyCode)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">Received By</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.DropDownList("EmployeeID", String.Empty)
                @Html.ValidationMessageFor(model => model.Employee.EngName)
            </td>
            <td class="editor-label" width="10%" scope="row">Customer:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.CustomerID)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">&nbsp;</td>
            <td class="editor-field" width="30%" scope="row">&nbsp;</td>
            <td class="editor-label" width="10%" scope="row">Tel:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.ContactID)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">Order Deadline:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.Deadline)
            </td>
            <td class="editor-label" width="10%" scope="row">Contact Person:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.ContactID)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">Invoice No.:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.InvoiceNumber)
            </td>
            <td class="editor-label" width="10%" scope="row">&nbsp;</td>
            <td class="editor-field" width="30%" scope="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">Remark:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.Remark)
            </td>
            <td class="editor-label" width="10%" scope="row">&nbsp;</td>
            <td class="editor-field" width="30%" scope="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">Status:</td>
            <td class="editor-field" width="30%" scope="row">
                @Html.EditorFor(model => model.Status)
            </td>
            <td class="editor-label" width="10%" scope="row">&nbsp;</td>
            <td class="editor-field" width="30%" scope="row">&nbsp;</td>
          </tr>
        </table>

@*        <div class="editor-label">
            @Html.LabelFor(model => model.ReceivedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ReceivedDate)
            @Html.ValidationMessageFor(model => model.ReceivedDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Employee.EngName)
        </div>
        <div class="editor-field">
            @Html.DropDownList("EmployeeID", String.Empty)
            @Html.ValidationMessageFor(model => model.Employee.EngName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ContactID)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ContactID)
            @Html.ValidationMessageFor(model => model.ContactID)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Deadline)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Deadline)
            @Html.ValidationMessageFor(model => model.Deadline)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.InvoiceNumber)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.InvoiceNumber)
            @Html.ValidationMessageFor(model => model.InvoiceNumber)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Remark)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Remark)
            @Html.ValidationMessageFor(model => model.Remark)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ModifiedDate)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ModifiedDate)
            @Html.ValidationMessageFor(model => model.ModifiedDate)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Status)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Status)
            @Html.ValidationMessageFor(model => model.Status)
        </div>*@
    </fieldset>
    <div>&nbsp;</div>
    
    <fieldset><legend class="Product_Info">File Information</legend>
      <table width="60%" border="0" cellspacing="10">
          <tr>
            <td class="editor-label" width="10%" scope="row">
                @Html.LabelFor(model => model.Filename):
            </td>
            <td class="editor-field" width="60%" colspan="4">
                @Html.EditorFor(model => model.Filename)
                @Html.ValidationMessageFor(model => model.Filename)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10" scope="row"><label>Request:</label></td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsNewJob)
                @Html.LabelFor(model => model.IsNewJob)
            </td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsEM)
                @Html.LabelFor(model => model.IsEM)
            </td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsFTP)
                @Html.LabelFor(model => model.IsFTP)
            </td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsDVD)
                @Html.LabelFor(model => model.IsDVD)
            </td>
          </tr>
          <tr>
            <td width="10" scope="row">&nbsp;</td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsMac)
                @Html.LabelFor(model => model.IsMac)
            </td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsPC)
                @Html.LabelFor(model => model.IsPC)
            </td>
            <td class="editor-field" width="10">
                @Html.CheckBoxFor(model => model.IsTest)
                @Html.LabelFor(model => model.IsTest)
            </td>
            <td width="10">&nbsp;</td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">
                @Html.LabelFor(model => model.Notes)
            </td>
            <td colspan="4"><textarea name="txtNotes" id="Notes" cols="60" rows="5"></textarea></td>
          </tr>
          </table>
	</fieldset>
    <div>&nbsp;</div>     
	<fieldset><legend class="Product_Info">Quantity & Size</legend>
        <table width="60%" border="0" cellspacing="10">
          <tr>
            <td class="editor-label" width="10%" scope="row">
                @Html.LabelFor(model => model.Quantity):
            </td>
            <td class="editor-field" width="60%" colspan="4">
                @Html.EditorFor(model => model.Quantity)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">
                @Html.LabelFor(model => model.Size):
            </td>
            <td class="editor-field" width="60%" colspan="4">
                @Html.EditorFor(model => model.Size)
            </td>
          </tr>
          <tr>
            <td class="editor-label" width="10%" scope="row">
                @Html.LabelFor(model => model.Unit):
            </td>
            <td class="editor-field" width="60%" colspan="4">
                @Html.EditorFor(model => model.Unit)
            </td>
          </tr>
        </table>
    </fieldset>
    <div>&nbsp;</div> 
    
     

    @(Html.Kendo().TabStrip()
    .Name("tabstrip")
    .Items(items =>
    {
        var tabBanner = items.Add().Text("Banner").Content(TabBanner().ToHtmlString());
        var tabPhoto = items.Add().Text("Photo").Content(TabPhoto().ToHtmlString());
        var tabFilm = items.Add().Text("Film").Content(TabFilm().ToHtmlString());
        var tabInkjetPrint = items.Add().Text("Inkjet Print").Content(TabInkjetPrint().ToHtmlString());
        var tabKodakDigitalPrint = items.Add().Text("Kodak Digital Print").Content(TabKodakDigitalPrint().ToHtmlString());
        var tabLaserPrint = items.Add().Text("Laser Print").Content(TabLaserPrint().ToHtmlString());
        var tabTai = items.Add().Text("大噴部").Content(TabTai().ToHtmlString());
        var tabOffsetPrint = items.Add().Text("Offset Print").Content(TabOffsetPrint().ToHtmlString());
        var tabDesign = items.Add().Text("設計部").Content(TabDesign().ToHtmlString());

        var selectedTab = (string)ViewData["selectedTab"];
        switch (selectedTab)
        {
            case "tabBanner":
                tabBanner.Selected(true);
                break;
            default:
                tabBanner.Selected(true);
                break;
        }
    }))
    
    // --- Banner Tab
    @helper TabBanner()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 1;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "A01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "A02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "A03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "A04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "A05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Photo Tab
        @helper TabPhoto()
            {
                List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
                int i = 0;
                int productCategoryID = 2;
                string GroupNumber;
                int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "B01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "B02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "B03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "B04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "B05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Film Tab
    @helper TabFilm()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 3;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "C01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "C02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "C03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "C04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "C05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Inkjet Print Tab
    @helper TabInkjetPrint()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 4;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "D01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "D02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "D03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "D04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "D05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    
    // --- KodakDigitalPrint Tab
    @helper TabKodakDigitalPrint()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 5;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "E01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "E02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "E03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "E04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "E05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Laser Print Tab
    @helper TabLaserPrint()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 6;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "F01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "F02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "F03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "F04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "F05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Tai Tab
    @helper TabTai()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 7;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "G01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "G02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "G03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "G04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "G05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- OffsetPrint Tab
    @helper TabOffsetPrint()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 8;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "H01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "H01";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "H03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "H04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "H05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    } 
    
    // --- Design Tab
    @helper TabDesign()
        {
            List<FingerPrint.WebUI.ViewModels.SelectedSalesOrderProducts> products = ViewBag.Products;
            int i = 0;
            int productCategoryID = 9;
            string GroupNumber;
            int itemPerLine = 4;
            
        <fieldset>    
            <legend><strong>機種</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                @{
                    i = 0;
                    GroupNumber = "I01";

                    var productGroup1 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:</tr><tr> 
                        }                     
                            @:<td width="20%" align="left" scope="row"> 
                                <input type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                               @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                               @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @:</tr>
                    }
            </table>
            </div>
        </fieldset>
        <br/>
            
        <fieldset>    
            <legend><strong>用紙</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "I02";

                    var productGroup2 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>過膠</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "I03";

                    var productGroup3 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包邊</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{

                    i = 0;
                    GroupNumber = "I04";

                    var productGroup4 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
        <br/>
        <fieldset>    
            <legend><strong>包裝</strong></legend>
            <div class="editor-field">
            <table style="width: 60%">
                <tr>
                @{
                    i = 0;
                    GroupNumber = "I05";

                    var productGroup5 = products
                        .Where(pc => pc.ProductCategoryID == productCategoryID && pc.GroupNumber == GroupNumber);

                    foreach (var product in productGroup1)
                    {
                        if (i++ % itemPerLine == 0)
                        {
                            @:  </tr><tr> 
                        }
                        
                            @: <td width="20%" align="left" scope="row"> 
                                <input   type="checkbox" 
                                        name="@product.ProductID" 
                                        value="@product.ProductID" 
                                        @(Html.Raw(product.Selected ? "checked=\"checked\"" : "")) /> 
                                        @product.ProductID @:&nbsp; @product.Description
                            @:</td>
                        }
                            @: </tr>
                        }
            </table>
            </div>
        </fieldset>
    }  
    
    <p><input type="submit" value="Save" /></p>
    
    <div>
        @Html.ActionLink("Back to List", "Index")
    </div>
    
}
